package com.chzc.fm.duotin.bean.home;

import com.google.gson.Gson;
import com.google.gson.reflect.TypeToken;

import java.lang.reflect.Type;
import java.util.ArrayList;
import java.util.List;

/**
 * Created by Administrator on 2016/7/5.
 */
public class LastCommandDataList {


    /**
     * id : 49071
     * content : 小米竟然开始做线下店，不知道互联网时代线上会不会又开始转型到线下实体
     * is_owner : false
     * created : 2016-07-05 09:38:51
     */

    private CommentBean comment;
    /**
     * id : 0
     * content :
     */

    private FromCommentBean from_comment;
    /**
     * id : 1532484
     * real_name : 书尽几何
     * image_url : http://c3.duotin.com/i1/DT/JV-BUhJFp-c9t60I-F17OjKoghgCVbWmMHT5kXBTkGY.jpg
     */

    private UserBean user;
    /**
     * id : 1461026
     * title : 艾问吴晓波：万科将死愚昧使然
     */

    private ContentBean content;
    /**
     * id : 85273
     * title : 艾问人物
     * image_url :
     */

    private AlbumBean album;
    /**
     * comment : {"id":"49071","content":"小米竟然开始做线下店，不知道互联网时代线上会不会又开始转型到线下实体","is_owner":false,"created":"2016-07-05 09:38:51"}
     * from_comment : {"id":"0","content":""}
     * user : {"id":"1532484","real_name":"书尽几何","image_url":"http://c3.duotin.com/i1/DT/JV-BUhJFp-c9t60I-F17OjKoghgCVbWmMHT5kXBTkGY.jpg"}
     * content : {"id":"1461026","title":"艾问吴晓波：万科将死愚昧使然"}
     * album : {"id":"85273","title":"艾问人物","image_url":""}
     * critics : null
     */

    private Object critics;

    public static LastCommandDataList objectFromData(String str) {

        return new Gson().fromJson(str, LastCommandDataList.class);
    }

    public static List<LastCommandDataList> arrayLastCommandDataListFromData(String str) {

        Type listType = new TypeToken<ArrayList<LastCommandDataList>>() {
        }.getType();

        return new Gson().fromJson(str, listType);
    }

    public CommentBean getComment() {
        return comment;
    }

    public void setComment(CommentBean comment) {
        this.comment = comment;
    }

    public FromCommentBean getFrom_comment() {
        return from_comment;
    }

    public void setFrom_comment(FromCommentBean from_comment) {
        this.from_comment = from_comment;
    }

    public UserBean getUser() {
        return user;
    }

    public void setUser(UserBean user) {
        this.user = user;
    }

    public ContentBean getContent() {
        return content;
    }

    public void setContent(ContentBean content) {
        this.content = content;
    }

    public AlbumBean getAlbum() {
        return album;
    }

    public void setAlbum(AlbumBean album) {
        this.album = album;
    }

    public Object getCritics() {
        return critics;
    }

    public void setCritics(Object critics) {
        this.critics = critics;
    }

    public static class CommentBean {
        private String id;
        private String content;
        private boolean is_owner;
        private String created;

        public static CommentBean objectFromData(String str) {

            return new Gson().fromJson(str, CommentBean.class);
        }

        public static List<CommentBean> arrayCommentBeanFromData(String str) {

            Type listType = new TypeToken<ArrayList<CommentBean>>() {
            }.getType();

            return new Gson().fromJson(str, listType);
        }

        public String getId() {
            return id;
        }

        public void setId(String id) {
            this.id = id;
        }

        public String getContent() {
            return content;
        }

        public void setContent(String content) {
            this.content = content;
        }

        public boolean isIs_owner() {
            return is_owner;
        }

        public void setIs_owner(boolean is_owner) {
            this.is_owner = is_owner;
        }

        public String getCreated() {
            return created;
        }

        public void setCreated(String created) {
            this.created = created;
        }
    }

    public static class FromCommentBean {
        private String id;
        private String content;

        public static FromCommentBean objectFromData(String str) {

            return new Gson().fromJson(str, FromCommentBean.class);
        }

        public static List<FromCommentBean> arrayFromCommentBeanFromData(String str) {

            Type listType = new TypeToken<ArrayList<FromCommentBean>>() {
            }.getType();

            return new Gson().fromJson(str, listType);
        }

        public String getId() {
            return id;
        }

        public void setId(String id) {
            this.id = id;
        }

        public String getContent() {
            return content;
        }

        public void setContent(String content) {
            this.content = content;
        }
    }

    public static class UserBean {
        private String id;
        private String real_name;
        private String image_url;

        public static UserBean objectFromData(String str) {

            return new Gson().fromJson(str, UserBean.class);
        }

        public static List<UserBean> arrayUserBeanFromData(String str) {

            Type listType = new TypeToken<ArrayList<UserBean>>() {
            }.getType();

            return new Gson().fromJson(str, listType);
        }

        public String getId() {
            return id;
        }

        public void setId(String id) {
            this.id = id;
        }

        public String getReal_name() {
            return real_name;
        }

        public void setReal_name(String real_name) {
            this.real_name = real_name;
        }

        public String getImage_url() {
            return image_url;
        }

        public void setImage_url(String image_url) {
            this.image_url = image_url;
        }
    }

    public static class ContentBean {
        private String id;
        private String title;

        public static ContentBean objectFromData(String str) {

            return new Gson().fromJson(str, ContentBean.class);
        }

        public static List<ContentBean> arrayContentBeanFromData(String str) {

            Type listType = new TypeToken<ArrayList<ContentBean>>() {
            }.getType();

            return new Gson().fromJson(str, listType);
        }

        public String getId() {
            return id;
        }

        public void setId(String id) {
            this.id = id;
        }

        public String getTitle() {
            return title;
        }

        public void setTitle(String title) {
            this.title = title;
        }
    }

    public static class AlbumBean {
        private String id;
        private String title;
        private String image_url;

        public static AlbumBean objectFromData(String str) {

            return new Gson().fromJson(str, AlbumBean.class);
        }

        public static List<AlbumBean> arrayAlbumBeanFromData(String str) {

            Type listType = new TypeToken<ArrayList<AlbumBean>>() {
            }.getType();

            return new Gson().fromJson(str, listType);
        }

        public String getId() {
            return id;
        }

        public void setId(String id) {
            this.id = id;
        }

        public String getTitle() {
            return title;
        }

        public void setTitle(String title) {
            this.title = title;
        }

        public String getImage_url() {
            return image_url;
        }

        public void setImage_url(String image_url) {
            this.image_url = image_url;
        }
    }
}
